Why a long, varied room is cut into regions, how to make them fit with the fewest tiles, and what a region's song, events and calls do in the game.
You have a long room, a boardwalk that runs into a pier that runs into a beach, and it looks great. Then Gbabel tells you it has too many tiles. This page is about why that happens and what to do about it, and it is easier than it sounds: regions are the answer, and you can make them in a click.
The console can show 1,024 different tiles at once, and not one more. A tile is one 8 by 8 square of picture, and two squares that look the same count once. In a room that is one screen big, that is plenty. In a room that is ten screens long, with a boardwalk, a pier, a beach and a lighthouse, each part wants its own planks, its own sand and its own rocks, and all of them together are far more than 1,024.
The trick is that the console never looks at the whole room. It looks at one screen at a time. So you tell Gbabel which parts of the room are which, and the game loads only the tiles of the part the camera is in. Those parts are the regions. You cut the room into regions in Room Properties, in the Regions section at its bottom, just above Doors (it works for any room longer or taller than one screen, and it is the same tool a world uses; a room one screen big shows it grayed, since it needs no regions; see regions in a world). Each region has its own tile sets, and the Tile Palette shows the selected region's.
If that were the whole story you would just cut the room anywhere. The catch is the border. When the camera stands near the line between two regions, it sees a little of both, so the console needs both regions' tiles at the same time. The numbers add up.
Here is a real example. A room four screens wide has a Boardwalk on screens 1 and 2 and a Pier on screens 3 and 4. The Boardwalk uses 545 different tiles and the Pier uses 500. Each is fine alone. But at the border:


545 + 500 = 1,045, and the console shows 1,024. That is 21 too many, so the game could not draw that border. Gbabel says so in the Problems list, in these words: "85 of the tiles of "Boardwalk" are used only within one screen of "Pier"; using the tiles "Pier" already has there instead would make this border fit."
Look at what that says. Out of the Boardwalk's 545 tiles, 85 are used only in its last screen, the one right next to the Pier. The rest, 460, are used further back. So paint those 85 squares with tiles the Pier already has. The Pier's tiles are loaded anyway, so those 85 no longer cost anything of their own: the border now needs 460 + 500 = 960, and it fits with 64 tiles to spare. (The Boardwalk's row still counts its 545, borrowed ones included, but its limit grows to 609, because the tiles it shares with the Pier are loaded only once.)
Does it look bad? No, and that is exactly the trick. It is also what looks natural: real places blend at their edges rather than switching on a hard line. A boardwalk that has a few pier planks and some pier rope near the pier looks like a place where one slowly turns into the other. You were going to want that anyway.
If a region is about one screen wide, the regions on its two sides are close enough to each other that one camera position can want both of them. So all three are loaded together, and their tiles add up.


With West at 380 tiles, Gate at 240 and East at 360, together they come to 980 and fit. Let West grow to 460 and they would not, even though no single border looks crowded. Gbabel says so in the row (Only one screen wide, so "West" and "East" load with it.) and the Problems list makes one problem of the three, not two. The cure is the same as before: borrow tiles near the borders, or make the narrow region wider so the two outer ones are further apart.
A region in a long room can do the same things as one in a world:
music_fade_to does: the old one fades out, the new one fades in. A region with no song leaves the music alone.region_name, region_current, region_previous, region_entered, region_exited, region_music and region_set_music work as they do in a world. Your code names a region with a word made from its name: rg_pier for a region called "Pier". Rename a region and its word in your code changes with it.Who counts as "the player"? The object the camera follows (the one you gave to camera_follow). Each frame, before the Step events, the game looks at which region that object stands in.
Leaving a house. The game remembers the last region the player was in. Walking into a house (a different room) and out again into the same region is not entering it again: no event, no cutscene, and the song simply comes back if the house played another one. Coming out into a different region is a change.
Both work in the same game. While the player is in a long room, the long room's regions answer: its songs play, its events and cutscenes run, and the calls (region_name, region_current, region_at and the rest) say the long room's region. While the player is in the world, the world's regions answer.
The game keeps one last region for the two. Going through a door from the world into a long room is a change like any other: the world's region is left (Region Exited) and the long room's is entered (Region Entered, its song, its cutscene). Coming back out into the world is a change too, because the last region was the long room's. A house with no regions of its own (an ordinary room) works as it always did: going in and coming out into the same region is not a change.
Every region has its own number, so the two never get mixed up: use the rg_ words rather than typing a number. region_at answers for a place in whichever one the player is in: in a long room, a place of that room; in the world, a place of the world.
The shroud (the dark layer that lights cut holes in) and a region's own background color are only for worlds. A long room has neither. Its background and its lights are the room's own.
A long room whose regions have no song, and whose code, objects and cutscenes never ask about regions, costs the game nothing for any of this.